package com.csd.action.team;

import java.util.List;

import com.csd.helper.ActionResult;
import com.csd.helper.SessionManager;
import com.csd.pojo.ChangeRecord;
import com.csd.pojo.Project;
import com.csd.service.IChangeRecordService;
import com.csd.serviceImpl.ChangeRecordService;
import com.csd.serviceImpl.ProjectService;


/**
 * 
 * Action：查询项目的所有变更信息
 * @author csd
 * @version 1.0
 * 
 * <br> 修订时间：2009-12-17
 * <br> 修改原因：创建文件
 * <br> 修改人：刘世彬
 * 
 * <br> 
 * 
 */
public class ChangeListAction {
	/** 项目ID */
	private String projectID;

	/**查询到的变更列表 */
	private List<ChangeRecord> listOfChange;

	private String projectState;
	
	private ProjectService projectService;
	
	
	public ProjectService getProjectService() {
		return projectService;
	}

	public void setProjectService(ProjectService projectService) {
		this.projectService = projectService;
	}

	
	public String getProjectState() {
		return projectState;
	}

	public void setProjectState(String projectState) {
		this.projectState = projectState;
	}

	private IChangeRecordService service;

	

	public IChangeRecordService getService() {
		return service;
	}

	public void setService(IChangeRecordService service) {
		this.service = service;
	}

	public String getProjectID() {
		return projectID;
	}

	public void setProjectID(String projectID) {
		this.projectID = projectID;
	}

	public List<ChangeRecord> getListOfChange() {
		return listOfChange;
	}

	public void setListOfChange(List<ChangeRecord> listOfChange) {
		this.listOfChange = listOfChange;
	}

	public String execute() {
		String result = ActionResult.fail;
		
		List list = projectService.listTeamProject();
		if(list!=null && list.size()>0)
		{
			Project project = (Project)list.get(0);
			this.projectState = project.getState();
		this.listOfChange = service.listChangeRecordByTeam();	
		}
		
		result = ActionResult.success;
		
		return result;
	}
}
